<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>数据管理</title>
    <link href="../css/bootstrap-cerulean.css" rel="stylesheet">
    <link href="../css/charisma-app.css" rel="stylesheet">
    <link href='../css/chosen.css' rel='stylesheet'>
    <link href='../css/uniform.default.css' rel='stylesheet'>
    <link href='../css/uploadify.css' rel='stylesheet'>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }
    </style>
    <script src="http://lib.sinaapp.com/js/jquery/2.2.4/jquery-2.2.4.min.js"></script>
    <script src="../js/common/public.js"></script>
    <script src="../js/base64.js"></script>
    <script src="../js/bootstrap-typeahead.js"></script>
    <script src="../js/bootstrap-dropdown.js"></script>
    <script type="text/javascript">
        function resetStudent() {
            if (window.confirm('确定要重置学生分数吗？')) {
                var urlMsg = parseUrl(window.location.search);
                $("#token").val(urlMsg.token);
                if (urlMsg.token != null) {
                    var token = decode(urlMsg.token);
                    token = token.substring(0, token.length - 1);
                }
                var html = $.ajax({
                    type: "PUT",
                    url: "http://localhost:1068/admin/student/resetStudent?token=" + token,
                    async: false
                }).responseText;
                var result = eval('(' + html + ')');
                if (result.code != 200) {
                    alert(result.msg)
                } else {
                    alert("重置成功！")
                }
            } else {
                return false;
            }
        }
        function resetClass() {
            if (window.confirm('确定要重置班级分数吗？')) {
                var urlMsg = parseUrl(window.location.search);
                $("#token").val(urlMsg.token);
                if (urlMsg.token != null) {
                    var token = decode(urlMsg.token);
                    token = token.substring(0, token.length - 1);
                }
                var html = $.ajax({
                    type: "PUT",
                    url: "http://localhost:1068/admin/class/resetClass?token=" + token,
                    async: false
                }).responseText;
                var result = eval('(' + html + ')');
                if (result.code != 200) {
                    alert(result.msg)
                } else {
                    alert("重置成功！")
                }
            } else {
                return false;
            }
        }
    </script>
</head>

<body>
<div class="container-fluid"
     style="padding-left:0px;padding-right:2px;">
    <div class="row-fluid">
        <div id="content" class="span10" style="width:100%;">
            <div class="row-fluid sortable">
                <div class="box span12">
                    <div class="box-header well">
                        <h2>
                            <i class="icon-edit"></i>数据管理
                        </h2>
                    </div>
                    <div class="box-content" style="text-align:center; padding-top:50px">

                        <fieldset>
                            <h1>数据信息管理</h1>
                            <br>
                            <br>
                            <br>
                            <br>
                            <div class="control-group">
                                <div class="controls">
                                    <a href="javascript:void(0);" id="resetStudent" onclick="resetStudent()">
                                        <button class="btn btn-primary" style="width:100px; margin-right:100px">学生操行重置
                                        </button>
                                    </a>
                                    <a href="javascript:void(0);" id="resetClass" onclick="resetClass()">
                                        <button class="btn btn-primary" style="width:100px;">班级量化重置</button>
                                    </a>
                                </div>
                            </div>
                            <br>
                            <br>
                            <br>
                            <br>
                        </fieldset>

                        <div style="padding-left:190px; padding-right:190px; text-align:left">
                            <h1>注意事项</h1>
                            <br>
                            <br>
                            <p>操行或量化重置即时将所有学生或班级的分数全部设置为80分，在每学期期末使用！。</p>
                            <br>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>